/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.cip.esymons.tramite.bc;

import java.util.List;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import org.cip.esymons.tramite.be.DirRecep;

/**
 *
 * @author ChristianATE
 */
@Stateless
public class DirRecepFacade implements DirRecepFacadeLocal {

    @PersistenceContext
    private EntityManager em;

    public void create(DirRecep dirRecep) {
        em.persist(dirRecep);
    }

    public void edit(DirRecep dirRecep) {
        em.merge(dirRecep);
    }

    public void remove(DirRecep dirRecep) {
        em.remove(em.merge(dirRecep));
    }

    public DirRecep find(Object id) {
        return em.find(DirRecep.class, id);
    }

    public List<DirRecep> findAll() {
        return em.createQuery("select object(o) from DirRecep as o").getResultList();
    }
}
